<?php
$router->group(['prefix' => 'v1','namespace' => 'Api\V1'], function($router) {
	$router->any('wechat/login', 'Wechat\WechatController@checkSignature');//登陆、获取token
	$router->get('class/page-rows', 'ActivityController@getActivityClassifPageRows');
	$router->get('banner/page-rows', 'ActivityController@getBanner');
	$router->get('help/page-rows', 'HelpController@getHelpPageRows');
	$router->post('upload-img', 'FileUploadController@uploadImg');
	$router->any('payments/wechat-notify', 'Wechat\WechatPayController@paynotify');//支付回调
	$router->post('site-config', 'HomeController@home');//创建订单

	$router->group(['middleware'=>['jwtAuth']],function ($router) {
		$router->group(['prefix' => 'order'],function ($router) {//,'middleware' => 'auth'
			$router->post('create', 'Wechat\WechatPayController@postCreateOrder');//创建订单
			$router->post('payment', 'Wechat\WechatPayController@payment');//支付
		});

		$router->group(['prefix' => 'Wechat','namespace' => 'Wechat'],function ($router) {
			$router->post('templ-msg', 'WechatController@templateMessage');//微信消息模版
		});

		$router->group(['prefix' => 'account'],function ($router) {//,'middleware' => 'auth'
			$router->post('info', 'AccountController@postAccountInfo');//更新个人资料信息
			$router->post('info/update', 'AccountController@AccountCreate');//更新个人资料信息
			$router->post('create-feedback', 'AccountController@postCreateFeedback');//提交反馈
			$router->post('address/create', 'AccountController@CreateAddress');//添加地址
			$router->post('address/edit', 'AccountController@editUserAddress');//修改地址
			$router->post('address/delete', 'AccountController@delUserAddress');//删除地址
			$router->post('address/page-rows', 'AccountController@AddressPageRows');//地址列表
			$router->post('create-data', 'AccountController@Create');//提交资料
			// $router->post('collect-goods', 'AccountController@postCollectGoods');//收货
			$router->post('activity-page-rows', 'AccountController@postActivityPageRows');//获取我报名的活动
		});

		//盒子操作
		$router->group(['prefix'=>'box'],function($router){
			$router->post('page-rows', 'BoxController@postPageRows');//盒子列表
			$router->post('give/page-rows', 'BoxController@postBoxGivePageRows');//赠送盒子列表
			$router->post('{box_id}', 'BoxController@postBoxInfo')->where('box_id','[0-9]+');//盒子列表
			$router->post('{box_id}/update', 'BoxController@postBoxUpdate')->where('box_id','[0-9]+');//更新盒子信息
			$router->post('{box_id}/change-status', 'BoxController@postBoxChangeStatus')->where('box_id','[0-9]+');//更新盒子信息
			$router->post('{box_id}/collocation/page-rows', 'BoxController@postBoxCollocationPageRows')->where('box_id','[0-9]+');//更新盒子信息
			$router->post('{box_id}/give-thank', 'BoxController@postBoxGiveThank')->where('box_id','[0-9]+');//更新盒子信息

			$router->post('share-give', 'BoxController@shareGive');//分享赠送
			$router->post('comment', 'BoxController@postBoxComment');//提交评论
			$router->post('{box_id}/retreat', 'BoxController@postBoxRetreat')->where('box_id','[0-9]+');//退换货
			$router->post('{box_id}/retreat/express', 'BoxController@postBoxRetreatExpress')->where('box_id','[0-9]+');//退换货
			$router->post('care/page-rows', 'BoxController@postCarePageRows');//关怀盒子
			$router->post('care/{box_id}', 'BoxController@postCareInfo')->where('box_id','[0-9]+');//关怀盒子详情
			$router->post('care/submit-data', 'BoxController@postCareSubmitData');//关怀盒子完善资料
			$router->post('care/{box_id}/untie', 'BoxController@postUntieBoxCare')->where('box_id','[0-9]+');//激活盒子
			$router->post('{box_id}/sign', 'BoxController@postBoxSign')->where('box_id','[0-9]+');//签收

			$router->post('{box_id}/address/update', 'BoxController@postBoxAddressUpate')->where('box_id','[0-9]+');//修改地址

		});

		$router->group(['prefix' => 'activity'],function ($router) {
			$router->post('page-rows', 'ActivityController@postPageRows');//活动列表
			$router->post('{activity_id}', 'ActivityController@postActivityInfo')->where('activity_id','[0-9]+');//活动详情
			$router->post('{activity_id}/join', 'ActivityController@postJoin')->where('activity_id','[0-9]+');//加入活动
		});
	});
});
